package com.heiye.user.biz.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @author: heiye
 * @date: 2024/11/20 下午12:30
 * @version: v1.0.0
 * @description:
 * 类型：
 * (1：母语 2：感兴趣的语言)
 */
@Getter
@AllArgsConstructor
public enum LanguageTypeEnum {
    NATIVE(1),
    INTEREST(2);

    // 类型
    private final Integer value;

    public static LanguageTypeEnum valueOf(Integer code) {
        for (LanguageTypeEnum languageTypeEnum : LanguageTypeEnum.values()) {
            if (Objects.equals(code, languageTypeEnum.getValue())) {
                return languageTypeEnum;
            }
        }
        return null;
    }
}
